package china.nanjing.mychancellor.config;

import com.netflix.loadbalancer.BestAvailableRule;
import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RoundRobinRule;
import com.netflix.loadbalancer.WeightedResponseTimeRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Chen Hongyu
 */
@Configuration(value ="feignConfigurationKingdom" )
public class FeignConfigurationKingdom {

    // 几种负载均衡 https://blog.csdn.net/rickiyeat/article/details/64918756
    // https://cloud.spring.io/spring-cloud-netflix/multi/multi_spring-cloud-ribbon.html
    @Bean
    public IRule iRule() {
        // return new BestAvailableRule();
        // 启动多个my-kingdom然后使用feign调用，看控制台轮询不同端口的应用
        return new RoundRobinRule();
    }

}
